import com.databricks.spark.sql.perf.tpcds.Tables
// Tables in TPC-DS benchmark used by experiments.
// dsdgenDir 为dsdgen的目录(需要先编译dsdgen).
// scalefactor 为数据量,GB
val tables = new Tables(sqlContext, "/data/ygmz/tpcds-kit/tools", 1)
// 生成数据.
tables.genData("hdfs://ochadoop02.jcloud.local:8020/tpctest", "parquet", true, false, false, false, false)
// Create metastore tables in a specified database for your data.
// 表创建完成后,自动切换到创建的数据库“sparktest”
tables.createExternalTables("hdfs://ochadoop02.jcloud.local:8020/tpctest", "parquet", "finaltest", false)
// 创建临时表
tables.createTemporaryTables(location, format)
// 设置 TPC-DS experiment
import com.databricks.spark.sql.perf.tpcds.TPCDS
val tpcds = new TPCDS (sqlContext = sqlContext)
//运行测试,测试集指定为tpcds1_4
val experiment = tpcds.runExperiment(tpcds.tpcds1_4Queries)